package cn.edu.scau.cmi.liangzijian.comprehension;

import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;

import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;


public class UIController {

    @FXML
    private ResourceBundle resources;

    @FXML
    private URL location;


    @FXML
    void abstractFactory(MouseEvent event) {
    	try {
    		FXMLLoader loader = new FXMLLoader(
    				getClass().getResource("/cn/edu/scau/cmi/liangzijian/abstractFactory/AbstractFactoryUI.fxml"));
    		
    		AnchorPane root = loader.load();
    				
    		Stage stage = new Stage();
    		stage.setTitle("lab3");
    		stage.setScene(new Scene(root));
    		stage.show();
    	} catch(IOException e) {
    	}
    }

    @FXML
    void adapter(MouseEvent event) {
    	try {
    		FXMLLoader loader = new FXMLLoader(
    				getClass().getResource("/cn/edu/scau/cmi/liangzijian/adapter/AdapterUI.fxml"));
    		
    		AnchorPane root = loader.load();
    				
    		Stage stage = new Stage();
    		stage.setTitle("lab4");
    		stage.setScene(new Scene(root));
    		stage.show();
    	} catch(IOException e) {
    	}
    }

    @FXML
    void composite_safe(MouseEvent event) {
    	try {
    		FXMLLoader loader = new FXMLLoader(
    				getClass().getResource("/cn/edu/scau/cmi/liangzijian/composite/safe/UI.fxml"));
    		
    		AnchorPane root = loader.load();
    		
    		Stage stage = new Stage();
    		stage.setTitle("lab5");
    		stage.setScene(new Scene(root));
    		stage.show();
    	} catch(IOException e) {
    	}
    }

    @FXML
    void composite_consistent(MouseEvent event) {
    	try {
    		FXMLLoader loader = new FXMLLoader(
    				getClass().getResource("/cn/edu/scau/cmi/liangzijian/composite/consistent/UI.fxml"));
    		
    		AnchorPane root = loader.load();
    		    		
    		Stage stage = new Stage();
    		stage.setTitle("lab5");
    		stage.setScene(new Scene(root));
    		stage.show();
    	} catch(IOException e) {
    	}
    }

    @FXML
    void factory(MouseEvent event) {
    	try {
    		FXMLLoader loader = new FXMLLoader(
    				getClass().getResource("/cn/edu/scau/cmi/liangzijian/factory/FactoryUI.fxml"));
    		
    		AnchorPane root = loader.load();
    				
    		Stage stage = new Stage();
    		stage.setTitle("lab3");
    		stage.setScene(new Scene(root));
    		stage.show();
    	} catch(IOException e) {
    	}	
    }

    @FXML
    void hibernate(MouseEvent event) {
    	try {
    		FXMLLoader loader = new FXMLLoader(
    				getClass().getResource("/cn/edu/scau/cmi/liangzijian/hibernate/UI.fxml"));
    		
    		AnchorPane root = loader.load();
    				
    		Stage stage = new Stage();
    		stage.setTitle("lab6");
    		stage.setScene(new Scene(root));
    		stage.show();
    	} catch(IOException e) {
    	}
    }

    @FXML
    void interProgramming(MouseEvent event) {
    	try {
	    	FXMLLoader loader = new FXMLLoader(
					getClass().getResource("/cn/edu/scau/cmi/liangzijian/interProgramming/UI.fxml"));
			
			AnchorPane root = loader.load();
			
			Stage stage = new Stage();
			stage.setTitle("lab1");
			stage.setScene(new Scene(root));
			stage.show();
    	} catch(IOException e) {
    	}
    }

    @FXML
    void simpleFactoryMethod(MouseEvent event) {
    	try {
    		FXMLLoader loader = new FXMLLoader(
    				getClass().getResource("/cn/edu/scau/cmi/liangzijian/simpleFactoryMethod/SimpleFactoryMethodUI.fxml"));
    		AnchorPane root = loader.load();
    				
    		Stage stage = new Stage();
    		stage.setTitle("lab3");
    		stage.setScene(new Scene(root));
    		stage.show();
    	} catch(IOException e) {
    	}
    }

    @FXML
    void singleton(MouseEvent event) {
    	try {
	    	FXMLLoader loader = new FXMLLoader(
					getClass().getResource("/cn/edu/scau/cmi/liangzijian/singleton/UI.fxml"));
			
			AnchorPane root = loader.load();
				
			Stage stage = new Stage();
			stage.setTitle("lab2");
			stage.setScene(new Scene(root));
			stage.show();
    	} catch(IOException e) {
    	}
    }

    @FXML
    void spring(MouseEvent event) {
    	try {
    		FXMLLoader loader = new FXMLLoader(
    				getClass().getResource("/cn/edu/scau/cmi/liangzijian/ioc/spring/UI.fxml"));
    		
    		AnchorPane root = loader.load();
    		    		
    		Stage stage = new Stage();
    		stage.setTitle("lab7");
    		stage.setScene(new Scene(root));
    		stage.show();
    	} catch(IOException e) {
    	}
    }

    @FXML
    void initialize() {


    }

}
